package com.fjrz.bbxwj.main.host.adpter

import android.widget.ImageView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.fjrz.bbxwj.R
import com.fjrz.bbxwj.entity.UserAttention
import com.module.lemlin.base.loadCircleImage

class AttentionAdapter :
    BaseQuickAdapter<UserAttention, BaseViewHolder>(R.layout.item_user_attention) {

    var mAttention: Int = 0

    init {
        addChildClickViewIds(R.id.tvAttentionPrivate)
    }

    override fun convert(holder: BaseViewHolder, item: UserAttention) {
        holder.setText(R.id.tvAttentionName, item.nickname)
            .setText(R.id.tvAttentionDesc, item.introduction)
            .setGone(R.id.tvAttentionAlready, mAttention != 0)
            .setGone(R.id.tvAttentionShow, true)
            .setGone(R.id.tvAttentionPrivate, mAttention != 2)
            .getView<ImageView>(R.id.ivAttentionAvatar).loadCircleImage(item.avatar)
    }
}